package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig 视频app
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 * https://blog.csdn.net/qq_21363853/article/details/116505382
 */

public class AlipayConfig2 {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String appId = "2021003117608096";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCwJeRgulZLGxvfqzcJa2rXrVLiVLPyZOAdvwztsRysqwrVaCMGOgQiK/Ks4u6qVAyNBJrOconxrJGc8j2VrRq32fft3FX+Jt2dZUoXGFiyoJV4q9v0vHp52VBZuUBu5wm7K2L1b3IsCMqIB220P1UJFzQiJWqaxwtREPk04+vz3rmRoxXUht2uKCMUlGS4GWowska1DuAj9xt/6z9tVIUAi/xt56aB+DlY3Y9tLZ6XV5TnmW/V2T7RHzmikxTH20YK+JeEscYy7Oi46ZH4V+r/t6zZzsVNxXgyuxagoWIicaKgP/eJsSDE7ANTMML7qdFKc8xrEryYQJ4LRiL//TQJAgMBAAECggEAZk3roR44JjDddH9tXKQtjowU2mzVgk+CNuSSLq6x97rzdNShmukxI2Og8zZt5TEhhPmKq6KsaVePzraGfBrorKUEsPpKW2zZQ6Pjbxxtz3kits4h1rds7r3/Q80rFf5LkZB2ThPnHJoSfwTJe2lZCwmV9ssCalh2QyP3iPdjP+Q+mPRo2ecrU5K4+0vplu2fJ4t7SbmRyBaA6Sxs6+LSZ1OjvWvItn5CMJhoKsfT+n4afS17FMgRt603uO/CRuXJon2ETFOauJgPoO7if+0hN/JyczGigJHW9Bo/1vSatdvNakS3lDxY19yNg9VO2md0QfzwszcX+Wz9ESOfz6ULfQKBgQD6h6tBc+7papYUk8bABb1KOk7jkujkP1Vh/slgk6Gqaull5lQ5GEKBKmyE5JwCrmi5dTlVnOBTp8qIBxWRDjmpWawl6MOTuikRfuYinqRxQ9OdsnGsLboAs5HKxuelam7QCkKb5o1oJtmJv+LsfRq3gmIOmmDdcjJkYlHAtYK4ewKBgQCz/neUJRWit3eiaF6cE1DmLJfQrGAxAF+QYr5Nf9ah8JKpPy1RKcTVj2pRKlk+HHpqWjXPPiZtkU3BxKeu5k9EDz32/MLKCmQh9LAx5G18rCzXipt+kvpTggglT5cdlfgGqZZjfkGfgJj3TYomNY5nTIKiYUxu+xXbB1TkJ874SwKBgQC9ANEgRfg9vB2RVJMilrHhZ+/QHCr61xTxIyiFZZsXWCTQrV1o3XZ+v6Sy9U0FcNKs51Tj08AhHHrc+Is6rcKukmofB2VU86K8AkJYZ9qjYIordE3xmWWz1cTtd/WWg58p8DOkLeEMbBK9qzflNdSMER8s6SaeqeJ+fPY0Ljt6NQKBgEI47WXj/wHO3oUyQRzLPohw/6oWwY1FxeMpcTqyPhV2nX8Hb3TdGT45dbRHEG55q9BVQFbvVtQZEbKo18jRk3hG41VryX7sM8sKa4jvshicgCMNLAh1qwPuY3DWx5JrCsXovxv758j3V1Alhx5ntezriWSUx7pNRs0+9Uy8GLnhAoGAPdTKxrjbGtt0p1ftxH6J8ryXv42OhjBtdzOp/on57U2cIGRMST4gZdWl31zX5wGHXoUTtT+/QLLmCG3VU2jMSbah8LCkPWgGCLhxzZvlFRZuryHH9/azJBsWlBzWTp5q26+S3alwU8RAsNnK0j5vf+v4BVyrzWggDiRX8gSk8o0=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh5H1MRjOphlVEjDVWNE/PEwKUzZWLBPfmLGq0A8/cdDVNkeFINp4eLNMRg/IjM1U1gZLJW1ex1afpCmfWwrQUVoANtY7ZE/bD0SHrwnLkWE7niQi5v4aG00r4d22hwrGsAmiQvuw4xV7rouCICCA8WoALRo2kBGGfPh9B41B7snubH6t5APfKH8FRJMeTY/iTUsjCgPSO/ut7hbmF7/vq3DFT9ujX40NZXTmm95gNEv3Bu4MAvNsuIeYhdQL3nako6S+chyYIDWXZp3SdZRNhWm9uEXNpRzYZgtpW1Ojd9AFI45p9dc9+81yEcs5Zr5QuZqigVb3fRsF14rEwPQ5pwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://192.168.0.39:8080/alipay/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://192.168.0.39:8080/alipay/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

